package com.jr.dao.impl;

import com.jr.dao.IUsersDao;
import com.jr.pojo.Users;
import com.jr.util.DBHelper;

import java.util.ArrayList;

public class UsersDaoImpl implements IUsersDao {

    DBHelper db = new DBHelper();

/*    @Override //根据账号查密码 没有返回0
    public String selectPwdByUserCode(String userCode) {
        String sql = "select password from users where userCode=?";
        ArrayList<Users> list = db.dtQuery(sql, Users.class, userCode);
        return list.size()>0?list.get(0).getPassword():"0";
    }*/

    @Override //根据账号 全查
    public ArrayList<Users> selectAllByUserCode(String userCode) {
        String sql = "select * from users where userCode=?";
        return db.dtQuery(sql, Users.class, userCode);
    }
}
